import proFetch from 'src/hrpub/common/utils/project-fetch';
import {COMMON} from "../main/util";

export default {
    name: 'transfer',
    data: {
        widget:false,
        language: {},
        conditions: {
            querycondition:{
                "logic":"and",
                "querytype":"tree",
                "conditions":[]
            }
        },
        templateIdObj:{

        },// 模板id 验证公式用
        formRelation2:[],// 批增 子集
        oid: null,// 查询模板oid
        oid2: null,// 批增查询模板oid
        hrorgobj: {},// 人力资源组织对象
        pageInfo: COMMON.pageInfo, // 主页面表格的分页信息
        page: COMMON.pageMain, // 显示的页面
        fileManagerBillId: null, // 附件billid
        fileManagerModalVisible: false, // 附件弹窗显示
        excuteVisible: false, // 执行弹窗显示
        organizationVisible: false, // 编制情况弹窗显示
        approveDetail: false, // 查看审批意见弹窗显示
        stapplyMode: null, // 调配方式
        trnsType: '', // 业务类型
        orderStatus: COMMON.orderStatus, // 单据状态
        orderTimeRange: COMMON.orderTimeRange, // 时间范围
        beginTime: '', // 开始时间
        endTime: '', // 结束时间
        isEditDetail: false, // 详情页是否是编辑态
        batchAddShow: false, // 是否显示批量新增弹窗
        batchAddCurrentStep: 0, // 批量新增弹窗当前步骤
        isapprove: 0, // 查看详情页用
        billid: null, // 单据ID
        billtype: '6113', // 单据ID
        compositedisplay: false, //是否显示 指派弹窗
        compositedata: null, //指派弹窗 数据
        compositepostdata: null ,//指派弹窗确定时传到后台的数据
        nodeRefs: {},
        transtypecode: {},
        init: false  
    },
    sync: {
        update(state, payload) {
            return {
                ...state,
                ...payload
            };
        }
    },
    async: {
        // 获取主页面表格数据
        getMainTableData(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/transapply/TransQueryAction.do',
                body: payload.postData
            });
        },
        // 获取详情页页面表单数据
        queryDetailData(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/transapply/TransQueryOneAction.do',
                body: payload.postData
            });
        },
        // 修改
        editAction(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/transapply/TransEditAction.do',
                body: payload.postData
            });
        },
        // 新增
        add(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/transapply/TransAddAction.do',
                body: payload.postData
            });
        },
        // 编辑前
        beforeEditAction(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/transapply/TransBeforeEditAction.do',
                body: payload.postData
            });
        },
        // 编辑后
        afterEditAction(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/transapply/TransAfterEditAction.do',
                body: payload.postData
            });
        },
        // 保存前校验
        saveCheckAction(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/transapply/TransSaveCheckAction.do',
                body: payload.postData
            });
        },
        // 保存
        saveAction(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/transapply/TransSaveAction.do',
                body: payload.postData
            });
        },
        // 取消
        cancelAction(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/transapply/TransCancelAction.do',
                body: payload.postData
            });
        },
        // 删除
        delAction(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/transapply/TransDelAction.do',
                body: payload.postData
            });
        },
        // 复制
        copyAction(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/transapply/TransCopyAction.do',
                body: payload.postData
            });
        },
        // 执行
        excuteAction(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/transapply/TransExcuteAction.do',
                body: payload.postData
            });
        },
        // 执行前校验
        beforeExcuteAction(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/transapply/TransBeforeExcuteAction.do',
                body: payload.postData
            });
        },
        // 提交
        commitAction(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/transapply/TransCommitAction.do',
                body: payload.postData
            });
        },
        // 收回
        callbackAction(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/transapply/TransCallbackAction.do',
                body: payload.postData
            });
        },
        // 编织情况
        checkBudgetAction(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/transapply/TransCheckBudgetAction.do',
                body: payload.postData
            });
        },
        // 批量新增
        batchAdd(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/transapply/TransBatchAddAction.do',
                body: payload.postData
            });
        },
        // 条件选人
        conditionSelPsn(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/transapply/TransBatchAddSelPsnByConditionAction.do',
                body: payload.postData
            });
        },
        // 参照选择人员
        batchAddSelPsnAction(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/transapply/TransBatchAddSelPsnAction.do',
                body: payload.postData
            });
        },
        // 下一步
        batchAddNextStepAction(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/transapply/TransBatchAddNextStepAction.do',
                body: payload.postData
            });
        },
        // 批增保存数据
        batchAddSaveAction(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/transapply/TransBatchAddSaveAction.do',
                body: payload.postData
            });
        },
        // 批增保存校验
        batchAddSaveCheckAction(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/transapply/TransBatchAddSaveCheckAction.do',
                body: payload.postData
            });
        },
        // 发送通知
        sendMsgAction(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/transapply/TransSendMsgAction.do',
                body: payload.postData
            });
        },
        // 查看合同
        getViewContractData(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/transapply/TransCheckCartAction.do',
                body: payload.postData
            });
        },
         //联查卡片
         linkSearch(dispatch,getState,payload) {
            return proFetch({
                url: '/nccloud/hrhi/psndoc/PsndocCardReptQueryAction.do',
                body: payload.postData
            })
        },
        //小部件跳转接口
        getWidgetTableData(dispatch,getState,payload){
            return proFetch({
                url: '/nccloud/hrtrn/widgets/ListData.do',
                body: payload.postData
            })
        }
    }
}
